clear,clc

for LUT_Rate_Symbols = [2 3 4 5 6]           %No of symbols corressponding to each rate.
    
    LFSR_Register = [0 0 0 0 0 0 0 0 1];

    N_Symbols = LUT_Rate_Symbols(1); % No of bits in one Symbol for the current rate

    for index = 1:256

        if (N_Symbols == 2 || N_Symbols == 3)
            LFSR_out(index) = bi2de(fliplr((LFSR_Register(9-N_Symbols+1:9))));
        else
            LFSR_out(index,:) = fliplr(LFSR_Register(9-N_Symbols+1:9));
        end


        for lfsr_index = 1:N_Symbols  %shifting by the number of symbols
            LFSR_Calc_Value = bitxor (LFSR_Register(9),LFSR_Register(5)) ;
            %Actually we are xoring the LFSR_Register(1) and LFSR_Register(5)
            %and the out in LFSR_Register(9), but the equation reversed for the
            %reason of LFSR_Register vector arrangement.
            LFSR_Register(2:9) = LFSR_Register (1:8);
            %shift one bit
            LFSR_Register(1) = LFSR_Calc_Value;
        end

    end

    eval(['save ' 'LFSR_NSymbols_' num2str(N_Symbols) ' LFSR_out']);
    clear LFSR_out
end